import  NavBar  from '../component/navbar.vue'
import TabBar  from '../component/tabBar.vue'

const routes = [
    {
        path: '/',
        components: {
            default: () => import('../views/home/index.vue'),
            footer: TabBar
        },
        meta: {
            title: '首页',
            icon: 'home-o',
            inMenu: true,
        }
    },
    {
        path: '/category',
        components: {
            header: NavBar,
            default: () => import('../views/category/index.vue'),
        },
        meta: {
            title: '分类',
        }
    },
    {
        path: '/menu',
        components: {
            header: NavBar,
            default: () => import('../views/menu/index.vue'),
            footer: TabBar
        },
        meta: {
            title: '菜谱',
            icon: 'todo-list',
            inMenu: true,
        }
    },
    {
        path: '/cart',
        components: {
            default: () => import('../views/cart/index.vue'),
            footer: TabBar
        },
        meta: {
            title: '购物车',
            icon: 'shopping-cart-o',
            inMenu: true,
        }
    },
    {
        path: '/detail',
        components: {
            header:NavBar,
            default: () => import('../views/home/details.vue'),
        },
        meta: {
            title: '商品详情',
        }
    },
    {
        path: '/mine',
        components: {
            default: () => import('../views/me/index.vue'),
            footer: TabBar
        },
        meta: {
            title: '我的',
            icon: 'user-o',
            inMenu: true,
        },
    },
    {
        path: '/login',
        components:{
            default:() => import('../views/login/index.vue'),
        } 
    },
    {
        path:'/register',
        components:{
            header:NavBar,
            default:()=>import('../views/login/register.vue')
        },
        meta:{
            title:'注册'
        }
    },
    {
        path:'/setup',
        components:{
            header:NavBar,
            default:()=>import('../views/me/setUp.vue')
        },
        meta:{
            title:'设置'
        }
    },
    {
        path:'/userInfo',
        components:{
            header:NavBar,
            default:()=>import('../views/me/userInfo.vue')
        },
        meta:{
            title:'个人资料'
        }
    },
    {
        path:'/menuDetail',
        components:{
            header:NavBar,
            default:()=>import('../views/menu/menuDetail.vue')
        },
        meta:{
            title:'菜谱详情'
        }
    },
    {
        path:'/sub',
        components:{
            default:()=>import('../views/cart/submit')
        }
    },
    {
        path:'/selectAddr',
        components:{
            header:NavBar,
            default:()=>import('../views/me/selectAddress')
        },
        meta:{
            title:'选择地址'
        }
    },
    {
        path:'/manageAddr',
        components:{
            header:NavBar,
            default:()=>import('../views/me/manageAddress')
        },
        meta:{
            title:'地址管理'
        }
    },
    {
        path:'/search',
        components:{
            default:()=>import('../views/home/search')
        }
    },
    {
        path:'/addAddr',
        components:{
            header:NavBar,
            default:()=>import('../views/me/addAddress')
        },
        meta:{
            title:'添加地址'
        }
    },
    {
        path:'/editAddr',
        components:{
            header:NavBar,
            default:()=>import('../views/me/editAddress')
        },
        meta:{
            title:'修改地址'
        }
    },
    {
        path:'/money',
        components:{
            default:()=>import('../views/me/myMoney')
        },
        meta:{
            title:'我的钱包'
        }
    },
    {
        path:'/pay',
        components:{
            header:NavBar,
            default:()=>import('../views/me/pay')
        },
        meta:{
            title:'待支付'
        }
    },
    {
        path:'/putaway',
        components:{
            header:NavBar,
            default:()=>import('../views/me/putAway')
        },
        meta:{
            title:'待收货'
        }
    }
]

export default routes